package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.order.domain.SyProductOrders;
import com.ruoyi.order.mapper.SyProductOrdersMapper;
import com.ruoyi.order.service.ISyProductOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 订单 Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-19
 */
@Service
public class SyProductOrdersServiceImpl implements ISyProductOrdersService
{
    @Autowired
    private SyProductOrdersMapper syProductOrdersMapper;

    /**
     * 查询订单 
     * 
     * @param orderId 订单 主键
     * @return 订单 
     */
    @Override
    public SyProductOrders selectSyProductOrdersByOrderId(String orderId)
    {
        return syProductOrdersMapper.selectSyProductOrdersByOrderId(orderId);
    }

    /**
     * 查询订单 列表
     * 
     * @param syProductOrders 订单 
     * @return 订单 
     */
    @Override
    public List<SyProductOrders> selectSyProductOrdersList(SyProductOrders syProductOrders)
    {
        return syProductOrdersMapper.selectSyProductOrdersList(syProductOrders);
    }

    /**
     * 新增订单 
     * 
     * @param syProductOrders 订单 
     * @return 结果
     */
    @Override
    public int insertSyProductOrders(SyProductOrders syProductOrders)
    {
        syProductOrders.setCreateTime(DateUtils.getNowDate());
        return syProductOrdersMapper.insertSyProductOrders(syProductOrders);
    }

    /**
     * 修改订单 
     * 
     * @param syProductOrders 订单 
     * @return 结果
     */
    @Override
    public int updateSyProductOrders(SyProductOrders syProductOrders)
    {
        syProductOrders.setUpdateTime(DateUtils.getNowDate());
        return syProductOrdersMapper.updateSyProductOrders(syProductOrders);
    }

    /**
     * 批量删除订单 
     * 
     * @param orderIds 需要删除的订单 主键
     * @return 结果
     */
    @Override
    public int deleteSyProductOrdersByOrderIds(String[] orderIds)
    {
        return syProductOrdersMapper.deleteSyProductOrdersByOrderIds(orderIds);
    }

    /**
     * 删除订单 信息
     * 
     * @param orderId 订单 主键
     * @return 结果
     */
    @Override
    public int deleteSyProductOrdersByOrderId(String orderId)
    {
        return syProductOrdersMapper.deleteSyProductOrdersByOrderId(orderId);
    }
}
